package com.linkwechat.wecom.client;

import com.dtflys.forest.annotation.*;
import com.linkwechat.wecom.domain.dto.WeResultDto;
import com.linkwechat.wecom.domain.dto.kf.*;
import com.linkwechat.wecom.interceptor.WeKfAccessTokenInterceptor;
import com.linkwechat.wecom.retry.WeCommonRetryWhen;

/**
 * Created by Administrator on 2022-1-15.
 */

@BaseRequest(baseURL = "${weComServerUrl}${weComePrefix}", interceptor = WeKfAccessTokenInterceptor.class)
@Retry(maxRetryCount = "3", maxRetryInterval = "1000", condition = WeCommonRetryWhen.class)
public interface WeKfClient {
    //获取会话状态
    @Request(url = "/kf/service_state/get",
            type = "POST"
    )
    ServiceStateGetResDto getServiceState(@JSONBody ServiceStateGetDto serviceStateGetDto);

    //变更会话状态
    @Request(url = "/kf/service_state/trans",
            type = "POST"
    )
    ServiceStateTransResDto transServiceState(@JSONBody ServiceStateTransDto serviceStateTransDto);

    //读取消息
    @Request(url = "/kf/sync_msg",
            type = "POST"
    )
    SyncMsgResDto syncMsg(@JSONBody SyncMsgDto syncMsgDto);

    //添加接待人员
    @Request(url = "/kf/servicer/add",
            type = "POST"
    )
    ServicerListResDto addServicer(@JSONBody ServicerDto addServicerDto);

    //删除接待人员
    @Request(url = "/kf/servicer/del",
            type = "POST"
    )
    ServicerListResDto delServicer(@JSONBody ServicerDto addServicerDto);

    //添加客服账号
    @Request(url = "/kf/account/add",
            type = "POST"
    )
    AddAccountResDto addAccount(@JSONBody AddAccountDto accountDto);

    //删除客服账号
    @Request(url = "/kf/account/del",
            type = "POST"
    )
    WeResultDto delAccount(@JSONBody OpenKfidDto openKfidDto);

    //获取客服账号链接
    @Request(url = "/kf/add_contact_way",
            type = "POST"
    )
    AddContactWayResDto addContactWay(@JSONBody AddContactWayDto addContactWayDto);

    //获取客服账号列表
    @Request(url = "/kf/account/list",
            type = "POST"
    )
    AccountListResDto getAccountList(@JSONBody AccountListDto accountListDto);

    //获取接待人员列表
    @Request(url = "/kf/servicer/list", type = "GET")
    ServicerListResDto getServicerList(@Query("open_kfid") String open_kfid);

    //配置专属会员
    @Request(url = "/kf/customer/upgrade_service",
            type = "POST"
    )
    WeResultDto upgrade_service(@JSONBody UpgradeServicerDto upgradeServicerDto);
}
